#include "ReutersDataModel.hpp"
#include "ReutersDocument.hpp"

#include <utility>


ReutersDataModel::ReutersDataModel(QObject *parent) :
    QObject(parent)
{
}


ReutersDocument* ReutersDataModel::createDocument (const QString& file, const QString& title) {
    ReutersDocument* d = new ReutersDocument (file, title);
    documents_.push_back(d);
    docsByFile_.insert(file, d);
    return d;
}


void ReutersDataModel::assignClass (const QString& file, const QString& cls) {
    ReutersDocument* d = document(file);
    d->assignTopic(cls);
    docsByClass_[cls].insert(d);
}
